<% open_release = @release && @release.releaseState == 'open'
   restore_label = icon('backward', 'Restore release') %>
<%= render_timeline_list_content(@timeline) do |builder, item| %>
  <% if item.is_a?(Cms::Release) && (item.releaseState == 'canceled' || (item.releaseState == 'closed' && @release.releaseId != item.releaseId)) %>
    <% builder.menu do %>
      <% if open_release %>
        <li class="disabled"><%= link_to_function(restore_label, '') %></li>
      <% else %>
        <%= link_busy(restore_label,
                      :url    => @environment ? restore_assembly_transition_environment_release_path(@assembly, @environment, item) : restore_assembly_design_release_path(@assembly, item),
                      :method => :post,
                      :remote => true) %>
      <% end %>
    <% end %>
  <% end %>
<% end %>
<div id="restore_release_warnings_modal" class="modal hide">
  <div class="modal-header">
    <button class="close" data-dismiss="modal">&times;</button>
    <h3 class="text-warning">Restore Release Warnings</h3>
  </div>
  <div class="modal-body">
    <p>Restored release with the following warnings (most likely due to incompatible pack/metadata changes):</p>
    <blockquote><ul></ul></blockquote>
    <p><strong class="label label-important">Please carefully review new release before commiting!</strong></p>
  </div>
  <div class="modal-footer">
  </div>
</div>
